<?php

require_once ('library/Zend/View/Helper/Abstract.php');

class Zend_View_Helper_WeiboMultiPics extends Zend_View_Helper_Abstract {
	public function weiboMultiPics($weiboid,$replace){
		$dbWeiboMultiPics = new Application_Model_DbTable_WeiboMultiPics();
		$res= $dbWeiboMultiPics->getPicsListById($weiboid);
		$str="<div>";
		foreach($res as $re){
		    if(stristr( $re['picurl'], DOMAIN_URL)){
		        if("square"==$replace){
		            $str.="<img src='".str_ireplace($weiboid.'/', $weiboid.'/thumbnail/', $re['picurl'])."' alt='玉石图片' title='玉石图片'/>";
		        }else{
		            $str.="<img src='".$re['picurl']."' alt='玉石图片' title='玉石图片'/>";
		        }
		    }else{
		        $str.="<img src='".str_ireplace('thumbnail', $replace, $re['picurl'])."' alt='玉石图片' title='玉石图片'/>";
		    }
		}
		$str.="</div>";
		return $str;
	}
}

?>